package awareness.defaults;

import events.Event;

/**
* @brief Eventos de metainformacion del sistema
* @author Carlos Rodriguez Dominguez
*
* Modela los eventos de metainformacion del sistema.
* Tiene un campo llamado "mi_type" que contiene el tipo
* de evento de metainformacion especifico. El campo "type"
* sera puesto al valor definido por MI_EVENT_TYPE.
*/
public class MIEvent extends Event {

	public static final int LOGIN = 0;
	public static final int DISCONNECT = 1;
	public static final int USER_CHANGE = 2;
	public static final int ROLE_CHANGE = 3;
	public static final int PERMISSIONS_CHANGE = 4;
	public static final int NEW_ALLOWED_ROLE = 5;
	public static final int REMOVE_ALLOWED_ROLE = 6;
	public static final int COMPONENT_PERMISSIONS_CHANGE = 7;
	public static final int USER_COMPONENT_PERMISSIONS_CHANGE = 8;
	public static final int ROLE_COMPONENT_PERMISSIONS_CHANGE = 9;
	public static final int SYNCHRONIZATION = 10;
	public static final int USER_ROLE_CHANGED = 11;
	public static final int NEW_USER = 12;
	public static final int NEW_ROLE = 13;
	public static final int REMOVE_USER = 14;
	public static final int REMOVE_ROLE = 15;
	
	public static final int MI_EVENT_TYPE = 555;
	
	/**
	* Constructor por defecto
	*/
	public MIEvent()
	{
		super();
		
		member_value("type", MI_EVENT_TYPE);
		member_value("mi_type", 0);
	}
	
	/**
	* Obtiene el tipo del evento de metainformacion
	*
	* @return Tipo del evento de metainformacion de entre
	*         los disponibles en @see MIEventType.
	*/
	public int get_subtype()
	{
		org.omg.CORBA.Any obj = member_value("mi_type");
		return obj.extract_long();
	}
}
